<?
session_start();
include('conn.php');
$qry1 = "SELECT * from tranentrymast where status=0 order by orderid desc";

$qry = mysql_query($qry1);
$data = array();
$i=1;
while($rows = mysql_fetch_array($qry))
{
	$data[] = array("orderid" => $rows['orderid'],
        			"orderdate" => $rows['orderdate'],
					"refnumber" => $rows['refnumber'],
				  "customername" => $rows['customername'],
				  "contactnumber" => $rows['contactnumber'],
				  "deliverydate"=> $rows['deliverydate'],
				  "soldby"=> $rows['soldby'],
				  "deliveredby"=> $rows['deliveredby'],
                    "glassfrom"=> $rows['glassfrom'],
                   "note"=> $rows['note'],
                   "remarks"=> $rows['remarks'],
                   "grandtotal"=> $rows['grandtotal'],
                   "advreceived"=> $rows['advreceived'],
                   "enteredby"=> $rows['enteredby'],
                   "entrydt"=> $rows['entrydt'],
                   "status"=> $rows['status']);
}
echo json_encode($data);
?>